/**
 * Copyright (c) 2015-2017, Henry Yang 杨勇 (gismail@foxmail.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.lambkit.module.upms;

import com.lambkit.Lambkit;
import com.lambkit.core.cache.CacheManager;
import com.lambkit.core.config.annotation.PropertieConfig;
import com.lambkit.plugin.rpc.RpcConfig;

@PropertieConfig(prefix="lambkit.upms")
public class UpmsConfig {

	private String type = "server";//server服务端、client客户端
	private String sessionId = "lambkit-upms-server-session-id";
	private int sessionTimeout = 1800000;
	private String ssoServerUrl = "/sso/login";
	private String successUrl = "/";
	private String unauthorizedUrl = "/error/403";
	private int rememberMeTimeout = 2592000;
	private String appId="lambkit";
	private String cacheType = CacheManager.TYPE_EHCACHE;
	/**
	 * 不拦截的url
	 */
	private String extUrls;
	
	private String localUrl;
	
	private String apiType = "http";
	private String apiUrl;
    private String rpcVersion = "1.0";
	/**
	 * 数据源配置
	 */
	private String dbconfig;

	/**
	 * 短信验证方式
	 */
	private String sms = "huawei";

	/**
	 * 敏感信息存储方式，normal、ASE、RSA
	 */
	private String sensitiveInfoStore = "normal";

	/**
	 * 激活用户权限
	 */
	private boolean activeUpmsPermission = false;

	/**
	 * 密码加密方式
	 */
	private String passwordEncrypt;

	/**
	 * 网站是否记住用户
	 */
	private boolean rememberMe = false;
	
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getSessionId() {
		return sessionId;
	}
	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}
	public int getSessionTimeout() {
		return sessionTimeout;
	}
	public void setSessionTimeout(int sessionTimeout) {
		this.sessionTimeout = sessionTimeout;
	}
	public String getSsoServerUrl() {
		return ssoServerUrl;
	}
	public void setSsoServerUrl(String ssoServerUrl) {
		this.ssoServerUrl = ssoServerUrl;
	}
	public String getSuccessUrl() {
		return successUrl;
	}
	public void setSuccessUrl(String successUrl) {
		this.successUrl = successUrl;
	}
	public String getUnauthorizedUrl() {
		return unauthorizedUrl;
	}
	public void setUnauthorizedUrl(String unauthorizedUrl) {
		this.unauthorizedUrl = unauthorizedUrl;
	}
	public int getRememberMeTimeout() {
		return rememberMeTimeout;
	}
	public void setRememberMeTimeout(int rememberMeTimeout) {
		this.rememberMeTimeout = rememberMeTimeout;
	}
	public String getAppId() {
		return appId;
	}
	public void setAppId(String appId) {
		this.appId = appId;
	}
	public String getDbconfig() {
		return dbconfig;
	}
	public void setDbconfig(String dbconfig) {
		this.dbconfig = dbconfig;
	}
	public int getRpcPort() {
		return Lambkit.config(RpcConfig.class).getDefaultPort();
	}
	public String getRpcGroup() {
		return Lambkit.config(RpcConfig.class).getDefaultGroup();
	}
	public String getRpcVersion() {
		return rpcVersion;
	}
	public void setRpcVersion(String rpcVersion) {
		this.rpcVersion = rpcVersion;
	}
	public String getCacheType() {
		return cacheType;
	}
	public void setCacheType(String cacheType) {
		this.cacheType = cacheType;
	}
	public String getLocalUrl() {
		return localUrl;
	}
	public void setLocalUrl(String localUrl) {
		this.localUrl = localUrl;
	}
	public String getApiType() {
		return apiType;
	}
	public void setApiType(String apiType) {
		this.apiType = apiType;
	}
	public String getExtUrls() {
		return extUrls;
	}
	public void setExtUrls(String extUrls) {
		this.extUrls = extUrls;
	}
	public String getSms() {
		return sms;
	}
	public void setSms(String sms) {
		this.sms = sms;
	}
	public String getSensitiveInfoStore() {
		return sensitiveInfoStore;
	}
	public void setSensitiveInfoStore(String sensitiveInfoStore) {
		this.sensitiveInfoStore = sensitiveInfoStore;
	}
	public boolean isRememberMe() {
		return rememberMe;
	}
	public void setRememberMe(boolean rememberMe) {
		this.rememberMe = rememberMe;
	}
	public boolean isActiveUpmsPermission() {
		return activeUpmsPermission;
	}
	public void setActiveUpmsPermission(boolean activeUpmsPermission) {
		this.activeUpmsPermission = activeUpmsPermission;
	}
	public String getPasswordEncrypt() {
		return passwordEncrypt;
	}
	public void setPasswordEncrypt(String passwordEncrypt) {
		this.passwordEncrypt = passwordEncrypt;
	}

	public String getApiUrl() {
		return apiUrl;
	}
	public void setApiUrl(String apiUrl) {
		this.apiUrl = apiUrl;
	}
}
